home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2005 July
/
CHIP_CD_2005-07.iso
/
software
/
att
/
attsetup.exe
/
Smart Shaders
/
Ghost.pss
< prev
next >
Wrap
Text File
|
2003-11-02
|
1KB
|
41 lines
shader ghostPixelShader =
"!!ARBfp1.0
# Increasing the ghostFactor will increase the severity of this effect.
# To keep things the same brightness curFrameFactor and ghostFactor should
# add up to 1.
PARAM curFrameFactor = {0.2, 0.2, 0.2, 0.0};
PARAM ghostFactor = {0.8, 0.8, 0.8, 0.0};
TEMP thisFramesPixel;
TEMP lastFramesPixel;
OUTPUT oColor = result.color;
TEX thisFramesPixel, fragment.texcoord[0], texture[0], 2D;
TEX lastFramesPixel, fragment.texcoord[0], texture[1], 2D;
MUL thisFramesPixel, thisFramesPixel, curFrameFactor;
MAD oColor, lastFramesPixel, ghostFactor, thisFramesPixel;
END";
shader copyPixelShader =
"!!ARBfp1.0
OUTPUT oColor = result.color;
TEMP pixel;
TEX pixel, fragment.texcoord[0], texture[0], 2D;
MOV oColor, pixel;
END";
surface temp = allocsurf(width, height);
texture[0].source = backbuffer;
texture[1].source = temp;
destination temp;
apply ghostPixelShader;
texture[0].source = temp;
destination backbuffer;
apply copyPixelShader;